import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';


import '../../AppConfig/Config.dart';
import '../../AppConfig/RouteAct.dart';
import 'CostNegotiation.dart';
import 'DirectComplaints.dart';
import 'FrequentlyAQ.dart';

class InitiateComplaint extends StatefulWidget {
  const InitiateComplaint({super.key});

  @override
  State<InitiateComplaint> createState() => _InitiateComplaintState();
}

class _InitiateComplaintState extends State<InitiateComplaint> {
  List QAList=["货损情况怎么办？","禁区被罚款了，货主不愿意负责怎么办？","司机临时要加钱怎么处理？","司机一只拖着不寄回单","我被押车了，怎么办？","司机迟到爽约怎么处理？",
    "投诉单显示对方已拒绝？","被投诉在哪里看？","投诉显示待货主确认怎么处理？","投诉有效期是多久？","各项纠纷补偿费用标准是什么？","货主不赔偿放空怎么办？"];
  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    return Scaffold(
      backgroundColor: MyColors.backgreyColor,
        appBar: AppBar(
        title:Text( "投诉服务",style: TextStyle(fontWeight: FontWeight.w300,fontSize: 16.sp),),
        backgroundColor: Colors.white,
        centerTitle: true,
        ),
      body: ListView(
        children: [
          Container(
            margin: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h),
            padding: EdgeInsets.only(top: 13.h,bottom: 13.h,right: 4.w),
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(10))),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Row(
                  children: [
                    Container(width: 4.w,height: 16.h,color: MyColors.themeColor,),
                    SizedBox(width: 14.w,),
                    Text("请选择协商类型",style: TextStyle(color: Colors.black,fontSize: 16.sp),),
                  ],
                ),
                GestureDetector(
                  child: Row(
                    children: [
                      Text("去协商",style: TextStyle(color: MyColors.themeColor),),
                      Icon(Icons.arrow_forward_ios,color: MyColors.themeColor,size: 20,),
                    ],
                  ),
                  onTap: (){
                    Navigator.push( context, FadeRoute(page:CostNegotiation()));
                  },
                ),
              ],
            ),
          ),
          Container(
            margin: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h),
            padding: EdgeInsets.only(top: 10.h,bottom: 10.h,right: 11.w,left: 11.w),
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(10))),
            child: Container(
              padding: EdgeInsets.only(left: 9.w,right: 12.w,top: 10.h,bottom: 10.h),

              decoration: BoxDecoration(
                color: Color.fromRGBO(255, 191, 107, 0.1),
                borderRadius: BorderRadius.all(Radius.circular(10)),
                border: Border.all(color: Color.fromRGBO(240, 133, 44, 1), width: 1), // 设置边框颜色和宽度
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Row(
                    children: [
                      Image.asset("lib/Images/OrderList/投诉服务协商icon.png",width: 34.w,height: 34.h,),
                      SizedBox(width: 5.w,),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text("快速催收费用",style: TextStyle(color: Colors.black),),
                          Text("要订金、要运费、要放空费、要押车费",style: TextStyle(color: MyColors.textColor,fontSize: 13.sp),),
                        ],
                      ),
                    ],
                  ),
                  Icon(Icons.arrow_forward_ios,size: 20,),
                ],
              ),
            ),
          ),
          Container(
            margin: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h),
            padding: EdgeInsets.only(top: 13.h,bottom: 21.h,right: 4.w,),
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(10))),
            child: Column(
              children: [
                Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Row(
                      children: [
                        Container(width: 4.w,height: 16.h,color: MyColors.themeColor,),
                        SizedBox(width:14.w ,),
                        Text("请选择投诉问题类型",style: TextStyle(color: Colors.black,fontSize: 16.sp),),
                      ],
                    ),
                    GestureDetector(
                      child: Row(
                        children: [
                          Text("直接投诉",style: TextStyle(color: MyColors.themeColor),),
                          Icon(Icons.arrow_forward_ios,color: MyColors.themeColor,size: 20,),
                        ],
                      ),
                      onTap: (){
                        Navigator.push( context, FadeRoute(page:DirectComplaints()));
                      },
                    ),
                  ],
                ),
                Divider(height: 16.h,color: MyColors.backgreyColor,),
                GestureDetector(
                  child:  Row(
                    children: [
                      SizedBox(width: 15.w,),
                      Image.asset("lib/Images/OrderList/押车投诉icon.png",width: 50.w,height: 50.h,),
                      SizedBox(width:10.w ,),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text("押车投诉",style: TextStyle(color: Colors.black),),
                          Text("装/卸货押车投诉",style: TextStyle(color: MyColors.textColor),),
                        ],
                      ),
                    ],
                  ),
                  onTap: (){

                  },
                ),
                SizedBox(height: 18.h,),
                GestureDetector(
                  child:  Row(
                    children: [
                      SizedBox(width: 10.w,),
                      Image.asset("lib/Images/OrderList/运费投诉icon.png",width: 55.w,height: 55.h,),
                      SizedBox(width:10.w ,),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text("运费投诉",style: TextStyle(color: Colors.black),),
                          Text("货主未按时结算运费",style: TextStyle(color: MyColors.textColor),),
                        ],
                      ),
                    ],
                  ),
                  onTap: (){

                  },
                ),
                SizedBox(height: 18.h,),
                GestureDetector(
                  child:  Row(
                    children: [
                      SizedBox(width: 10.w,),
                      Image.asset("lib/Images/OrderList/信息费投诉icon.png",width:50.w,height: 50.h,),
                      SizedBox(width:10.w ,),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text("信息费投诉",style: TextStyle(color: Colors.black),),
                          Text("未装到货，货主不退费，联系不上货主",style: TextStyle(color: MyColors.textColor),),
                        ],
                      ),
                    ],
                  ),
                  onTap: (){

                  },
                ),

              ],
            ),
          ),
          Container(
            margin: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h),
            padding: EdgeInsets.only(top: 13.h,bottom: 16.h,right: 4.w,),
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(10))),
            child: Column(
              children: [
                Row(
                  children: [
                    Container(width: 4.w,height: 16.h,color: MyColors.themeColor,),
                    SizedBox(width:14.w ,),
                    Text("投诉常见问题",style: TextStyle(color: Colors.black,fontSize: 16.sp),),
                  ],
                ),
                Container(
                  height:37.h*QAList.length,
                  child:  ListView.builder(
                padding: EdgeInsets.zero, // 设置padding为零
                      itemCount:  QAList.length,
                      itemBuilder: (BuildContext context,
                          int index) {
                  return Column(
                    children: [
                      Divider(height: 16.h,color: MyColors.backgreyColor,),
                      GestureDetector(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Row(
                              children: [
                                SizedBox(width: 14.w,),
                                Icon(Icons.help_outline,color: MyColors.authTipColor,),
                                SizedBox(width: 10.w,),
                                Container(
                                  width:screenSize.width-100.w,
                                  child:  Text("禁区被罚款了，货主不愿意负责任怎么办？",style: TextStyle(color: Colors.black,fontSize: 16.sp),maxLines: 1, // 设置最大行数为1
                                    overflow: TextOverflow.ellipsis, ),
                                ),

                              ],
                            ),
                            Icon(Icons.arrow_forward_ios,size: 20,color: MyColors.textColor,),

                          ],
                        ),
                        onTap: (){
                          Navigator.push( context, FadeRoute(page:FrequentlyAQ()));
                        },
                      ),

                    ],
                  );
                      }),
                )
              ],
            ),
          ),
        ],
      ),
    );
  }
}
